home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / SoundInput.a < prev    next >
Text File  |  1996-05-01  |  12KB  |  415 lines

  1. ;
  2. ;    File:        SoundInput.a
  3. ;
  4. ;    Contains:    Sound Input Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__SOUNDINPUT__') = 'UNDEFINED' THEN
  19. __SOUNDINPUT__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  25.     include 'AppleEvents.a'
  26.     ENDIF
  27.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  28.     include 'Windows.a'
  29.     ENDIF
  30.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  31.     include 'Dialogs.a'
  32.     ENDIF
  33.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  34.     include 'Files.a'
  35.     ENDIF
  36.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  37.     include 'Sound.a'
  38.     ENDIF
  39.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  40. ;
  41. ;                        * * *  N O T E  * * *
  42. ;
  43. ;    This file has been updated to include Sound Input Manager 1.1 interfaces.
  44. ;
  45. ;    Some of the Sound Input Manager 1.1 interfaces were not put into the InterfaceLib
  46. ;    that originally shipped with the PowerMacs. These missing functions and the
  47. ;    new 1.1 interfaces have been released in the SoundLib library for PowerPC
  48. ;    developers to link with. The runtime library for these functions are
  49. ;    installed by Sound Manager 3.2. The following functions are found in SoundLib.
  50. ;
  51. ;        ParseAIFFHeader(), ParseSndHeader()
  52. ;
  53. ;
  54.  
  55. siDeviceIsConnected                EQU        1                    ;input device is connected and ready for input
  56. siDeviceNotConnected            EQU        0                    ;input device is not connected
  57. siDontKnowIfConnected            EQU        -1                    ;can't tell if input device is connected
  58. siReadPermission                EQU        0                    ;permission passed to SPBOpenDevice
  59. siWritePermission                EQU        1                    ;permission passed to SPBOpenDevice
  60.  
  61.                                                             ;Info Selectors for Sound Input Drivers
  62. siActiveChannels                EQU        'chac'                ;active channels
  63. siActiveLevels                    EQU        'lmac'                ;active meter levels
  64. siAGCOnOff                        EQU        'agc '                ;automatic gain control state
  65. siAsync                            EQU        'asyn'                ;asynchronous capability
  66. siChannelAvailable                EQU        'chav'                ;number of channels available
  67. siCompressionAvailable            EQU        'cmav'                ;compression types available
  68. siCompressionFactor                EQU        'cmfa'                ;current compression factor
  69. siCompressionHeader                EQU        'cmhd'                ;return compression header
  70. siCompressionNames                EQU        'cnam'                ;compression type names available
  71. siCompressionType                EQU        'comp'                ;current compression type
  72. siContinuous                    EQU        'cont'                ;continous recording
  73. siDeviceBufferInfo                EQU        'dbin'                ;size of interrupt buffer
  74. siDeviceConnected                EQU        'dcon'                ;input device connection status
  75. siDeviceIcon                    EQU        'icon'                ;input device icon
  76. siDeviceName                    EQU        'name'                ;input device name
  77. siHardwareBusy                    EQU        'hwbs'                ;sound hardware is in use
  78. siInputGain                        EQU        'gain'                ;input gain
  79. siInputSource                    EQU        'sour'                ;input source selector
  80. siInputSourceNames                EQU        'snam'                ;input source names
  81. siLevelMeterOnOff                EQU        'lmet'                ;level meter state
  82. siModemGain                        EQU        'mgai'                ;modem input gain
  83. siNumberChannels                EQU        'chan'                ;current number of channels
  84. siOptionsDialog                    EQU        'optd'                ;display options dialog
  85. siPlayThruOnOff                    EQU        'plth'                ;playthrough state
  86. siRecordingQuality                EQU        'qual'                ;recording quality
  87. siSampleRate                    EQU        'srat'                ;current sample rate
  88. siSampleRateAvailable            EQU        'srav'                ;sample rates available
  89. siSampleSize                    EQU        'ssiz'                ;current sample size
  90. siSampleSizeAvailable            EQU        'ssav'                ;sample sizes available
  91. siSetupCDAudio                    EQU        'sucd'                ;setup sound hardware for CD audio
  92. siSetupModemAudio                EQU        'sumd'                ;setup sound hardware for modem audio
  93. siStereoInputGain                EQU        'sgai'                ;stereo input gain
  94. siTwosComplementOnOff            EQU        'twos'                ;two's complement state
  95. siVoxRecordInfo                    EQU        'voxr'                ;VOX record parameters
  96. siVoxStopInfo                    EQU        'voxs'                ;VOX stop parameters
  97. siCloseDriver                    EQU        'clos'                ;reserved for internal use only
  98. siInitializeDriver                EQU        'init'                ;reserved for internal use only
  99. siPauseRecording                EQU        'paus'                ;reserved for internal use only
  100. siUserInterruptProc                EQU        'user'                ;reserved for internal use only
  101.                                                             ;Qualities
  102. siCDQuality                        EQU        'cd  '                ;44.1kHz, stereo, 16 bit
  103. siBestQuality                    EQU        'best'                ;22kHz, mono, 8 bit
  104. siBetterQuality                    EQU        'betr'                ;22kHz, mono, MACE 3:1
  105. siGoodQuality                    EQU        'good'                ;22kHz, mono, MACE 6:1
  106.  
  107.  
  108. ; typedef SPB *                            SPBPtr
  109.  
  110. ; user procedures called by sound input routines
  111. ; Sound Input Parameter Block
  112. SPB                        RECORD 0
  113. inRefNum                 ds.l    1                ; offset: $0 (0)        ; reference number of sound input device
  114. count                     ds.l    1                ; offset: $4 (4)        ; number of bytes to record
  115. milliseconds             ds.l    1                ; offset: $8 (8)        ; number of milliseconds to record
  116. bufferLength             ds.l    1                ; offset: $C (12)        ; length of buffer in bytes
  117. bufferPtr                 ds.l    1                ; offset: $10 (16)        ; buffer to store sound data in
  118. completionRoutine         ds.l    1                ; offset: $14 (20)        ; completion routine
  119. interruptRoutine         ds.l    1                ; offset: $18 (24)        ; interrupt routine
  120. userLong                 ds.l    1                ; offset: $1C (28)        ; user-defined field
  121. error                     ds.w    1                ; offset: $20 (32)        ; error
  122. unused1                     ds.l    1                ; offset: $22 (34)        ; reserved - must be zero
  123. sizeof                     EQU *                    ; size:   $26 (38)
  124.                         ENDR
  125. ;
  126. ; pascal NumVersion SPBVersion(void )
  127. ;
  128.     IF ¨ GENERATINGCFM THEN
  129.         Macro
  130.         _SPBVersion
  131.             move.l              #$00000014,D0
  132.             dc.w                $A800
  133.         EndM
  134.     ELSE
  135.         IMPORT_CFM_FUNCTION SPBVersion
  136.     ENDIF
  137.  
  138. ;
  139. ; pascal OSErr SndRecord(ModalFilterUPP filterProc, Point corner, OSType quality, SndListHandle *sndHandle)
  140. ;
  141.     IF ¨ GENERATINGCFM THEN
  142.         Macro
  143.         _SndRecord
  144.             move.l              #$08040014,D0
  145.             dc.w                $A800
  146.         EndM
  147.     ELSE
  148.         IMPORT_CFM_FUNCTION SndRecord
  149.     ENDIF
  150.  
  151. ;
  152. ; pascal OSErr SndRecordToFile(ModalFilterUPP filterProc, Point corner, OSType quality, short fRefNum)
  153. ;
  154.     IF ¨ GENERATINGCFM THEN
  155.         Macro
  156.         _SndRecordToFile
  157.             move.l              #$07080014,D0
  158.             dc.w                $A800
  159.         EndM
  160.     ELSE
  161.         IMPORT_CFM_FUNCTION SndRecordToFile
  162.     ENDIF
  163.  
  164. ;
  165. ; pascal OSErr SPBSignInDevice(short deviceRefNum, ConstStr255Param deviceName)
  166. ;
  167.     IF ¨ GENERATINGCFM THEN
  168.         Macro
  169.         _SPBSignInDevice
  170.             move.l              #$030C0014,D0
  171.             dc.w                $A800
  172.         EndM
  173.     ELSE
  174.         IMPORT_CFM_FUNCTION SPBSignInDevice
  175.     ENDIF
  176.  
  177. ;
  178. ; pascal OSErr SPBSignOutDevice(short deviceRefNum)
  179. ;
  180.     IF ¨ GENERATINGCFM THEN
  181.         Macro
  182.         _SPBSignOutDevice
  183.             move.l              #$01100014,D0
  184.             dc.w                $A800
  185.         EndM
  186.     ELSE
  187.         IMPORT_CFM_FUNCTION SPBSignOutDevice
  188.     ENDIF
  189.  
  190. ;
  191. ; pascal OSErr SPBGetIndexedDevice(short count, Str255 deviceName, Handle *deviceIconHandle)
  192. ;
  193.     IF ¨ GENERATINGCFM THEN
  194.         Macro
  195.         _SPBGetIndexedDevice
  196.             move.l              #$05140014,D0
  197.             dc.w                $A800
  198.         EndM
  199.     ELSE
  200.         IMPORT_CFM_FUNCTION SPBGetIndexedDevice
  201.     ENDIF
  202.  
  203. ;
  204. ; pascal OSErr SPBOpenDevice(ConstStr255Param deviceName, short permission, long *inRefNum)
  205. ;
  206.     IF ¨ GENERATINGCFM THEN
  207.         Macro
  208.         _SPBOpenDevice
  209.             move.l              #$05180014,D0
  210.             dc.w                $A800
  211.         EndM
  212.     ELSE
  213.         IMPORT_CFM_FUNCTION SPBOpenDevice
  214.     ENDIF
  215.  
  216. ;
  217. ; pascal OSErr SPBCloseDevice(long inRefNum)
  218. ;
  219.     IF ¨ GENERATINGCFM THEN
  220.         Macro
  221.         _SPBCloseDevice
  222.             move.l              #$021C0014,D0
  223.             dc.w                $A800
  224.         EndM
  225.     ELSE
  226.         IMPORT_CFM_FUNCTION SPBCloseDevice
  227.     ENDIF
  228.  
  229. ;
  230. ; pascal OSErr SPBRecord(SPBPtr inParamPtr, Boolean asynchFlag)
  231. ;
  232.     IF ¨ GENERATINGCFM THEN
  233.         Macro
  234.         _SPBRecord
  235.             move.l              #$03200014,D0
  236.             dc.w                $A800
  237.         EndM
  238.     ELSE
  239.         IMPORT_CFM_FUNCTION SPBRecord
  240.     ENDIF
  241.  
  242. ;
  243. ; pascal OSErr SPBRecordToFile(short fRefNum, SPBPtr inParamPtr, Boolean asynchFlag)
  244. ;
  245.     IF ¨ GENERATINGCFM THEN
  246.         Macro
  247.         _SPBRecordToFile
  248.             move.l              #$04240014,D0
  249.             dc.w                $A800
  250.         EndM
  251.     ELSE
  252.         IMPORT_CFM_FUNCTION SPBRecordToFile
  253.     ENDIF
  254.  
  255. ;
  256. ; pascal OSErr SPBPauseRecording(long inRefNum)
  257. ;
  258.     IF ¨ GENERATINGCFM THEN
  259.         Macro
  260.         _SPBPauseRecording
  261.             move.l              #$02280014,D0
  262.             dc.w                $A800
  263.         EndM
  264.     ELSE
  265.         IMPORT_CFM_FUNCTION SPBPauseRecording
  266.     ENDIF
  267.  
  268. ;
  269. ; pascal OSErr SPBResumeRecording(long inRefNum)
  270. ;
  271.     IF ¨ GENERATINGCFM THEN
  272.         Macro
  273.         _SPBResumeRecording
  274.             move.l              #$022C0014,D0
  275.             dc.w                $A800
  276.         EndM
  277.     ELSE
  278.         IMPORT_CFM_FUNCTION SPBResumeRecording
  279.     ENDIF
  280.  
  281. ;
  282. ; pascal OSErr SPBStopRecording(long inRefNum)
  283. ;
  284.     IF ¨ GENERATINGCFM THEN
  285.         Macro
  286.         _SPBStopRecording
  287.             move.l              #$02300014,D0
  288.             dc.w                $A800
  289.         EndM
  290.     ELSE
  291.         IMPORT_CFM_FUNCTION SPBStopRecording
  292.     ENDIF
  293.  
  294. ;
  295. ; pascal OSErr SPBGetRecordingStatus(long inRefNum, short *recordingStatus, short *meterLevel, unsigned long *totalSamplesToRecord, unsigned long *numberOfSamplesRecorded, unsigned long *totalMsecsToRecord, unsigned long *numberOfMsecsRecorded)
  296. ;
  297.     IF ¨ GENERATINGCFM THEN
  298.         Macro
  299.         _SPBGetRecordingStatus
  300.             move.l              #$0E340014,D0
  301.             dc.w                $A800
  302.         EndM
  303.     ELSE
  304.         IMPORT_CFM_FUNCTION SPBGetRecordingStatus
  305.     ENDIF
  306.  
  307. ;
  308. ; pascal OSErr SPBGetDeviceInfo(long inRefNum, OSType infoType, void *infoData)
  309. ;
  310.     IF ¨ GENERATINGCFM THEN
  311.         Macro
  312.         _SPBGetDeviceInfo
  313.             move.l              #$06380014,D0
  314.             dc.w                $A800
  315.         EndM
  316.     ELSE
  317.         IMPORT_CFM_FUNCTION SPBGetDeviceInfo
  318.     ENDIF
  319.  
  320. ;
  321. ; pascal OSErr SPBSetDeviceInfo(long inRefNum, OSType infoType, void *infoData)
  322. ;
  323.     IF ¨ GENERATINGCFM THEN
  324.         Macro
  325.         _SPBSetDeviceInfo
  326.             move.l              #$063C0014,D0
  327.             dc.w                $A800
  328.         EndM
  329.     ELSE
  330.         IMPORT_CFM_FUNCTION SPBSetDeviceInfo
  331.     ENDIF
  332.  
  333. ;
  334. ; pascal OSErr SPBMillisecondsToBytes(long inRefNum, long *milliseconds)
  335. ;
  336.     IF ¨ GENERATINGCFM THEN
  337.         Macro
  338.         _SPBMillisecondsToBytes
  339.             move.l              #$04400014,D0
  340.             dc.w                $A800
  341.         EndM
  342.     ELSE
  343.         IMPORT_CFM_FUNCTION SPBMillisecondsToBytes
  344.     ENDIF
  345.  
  346. ;
  347. ; pascal OSErr SPBBytesToMilliseconds(long inRefNum, long *byteCount)
  348. ;
  349.     IF ¨ GENERATINGCFM THEN
  350.         Macro
  351.         _SPBBytesToMilliseconds
  352.             move.l              #$04440014,D0
  353.             dc.w                $A800
  354.         EndM
  355.     ELSE
  356.         IMPORT_CFM_FUNCTION SPBBytesToMilliseconds
  357.     ENDIF
  358.  
  359. ;
  360. ; pascal OSErr SetupSndHeader(SndListHandle sndHandle, short numChannels, UnsignedFixed sampleRate, short sampleSize, OSType compressionType, short baseNote, unsigned long numBytes, short *headerLen)
  361. ;
  362.     IF ¨ GENERATINGCFM THEN
  363.         Macro
  364.         _SetupSndHeader
  365.             move.l              #$0D480014,D0
  366.             dc.w                $A800
  367.         EndM
  368.     ELSE
  369.         IMPORT_CFM_FUNCTION SetupSndHeader
  370.     ENDIF
  371.  
  372. ;
  373. ; pascal OSErr SetupAIFFHeader(short fRefNum, short numChannels, UnsignedFixed sampleRate, short sampleSize, OSType compressionType, unsigned long numBytes, unsigned long numFrames)
  374. ;
  375.     IF ¨ GENERATINGCFM THEN
  376.         Macro
  377.         _SetupAIFFHeader
  378.             move.l              #$0B4C0014,D0
  379.             dc.w                $A800
  380.         EndM
  381.     ELSE
  382.         IMPORT_CFM_FUNCTION SetupAIFFHeader
  383.     ENDIF
  384.  
  385. ;  Sound Input Manager 1.1 and later calls 
  386. ;
  387. ; pascal OSErr ParseAIFFHeader(short fRefNum, SoundComponentData *sndInfo, unsigned long *numFrames, unsigned long *dataOffset)
  388. ;
  389.     IF ¨ GENERATINGCFM THEN
  390.         Macro
  391.         _ParseAIFFHeader
  392.             move.l              #$07580014,D0
  393.             dc.w                $A800
  394.         EndM
  395.     ELSE
  396.         IMPORT_CFM_FUNCTION ParseAIFFHeader
  397.     ENDIF
  398.  
  399. ;
  400. ; pascal OSErr ParseSndHeader(SndListHandle sndHandle, SoundComponentData *sndInfo, unsigned long *numFrames, unsigned long *dataOffset)
  401. ;
  402.     IF ¨ GENERATINGCFM THEN
  403.         Macro
  404.         _ParseSndHeader
  405.             move.l              #$085C0014,D0
  406.             dc.w                $A800
  407.         EndM
  408.     ELSE
  409.         IMPORT_CFM_FUNCTION ParseSndHeader
  410.     ENDIF
  411.  
  412.     ENDIF
  413.     ENDIF ; __SOUNDINPUT__ 
  414.  
  415.